﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestPlatform.Core;
using System.Data.SqlClient;

namespace TestPlatform.Performer.Mssql
{
    public class MssqlUpdatePerformer : BaseUpdatePerformer
    {
        public override string UnderlyinEngine { get { return "MSSQL"; } }

        public MssqlUpdatePerformer()
            : base(new MssqlHelper())
        {

        }

        protected override void UpdateEntity(Guid id)
        {
            using (var c = MssqlHelper.CreateConnection())
            {
                SqlCommand cmd = c.CreateCommand();

                cmd.CommandText = string.Format("UPDATE Users SET Name = '{0}' WHERE Id = '{0}'", id);
                cmd.ExecuteNonQuery();
            }
        }
    }
}
